<script setup lang="ts">
import BasicLayout from '@/layouts/BasicLayout.vue'
import { useLoginUserStore } from './stores/loginUser'
import { useRoute } from 'vue-router'
import { computed } from 'vue'

const loginUserStore = useLoginUserStore()
loginUserStore.fetchLoginUser()

const route = useRoute()

// 判断是否为认证页面（登录/注册）
const isAuthPage = computed(() => {
  return route.path === '/user/login' || route.path === '/user/register'
})
</script>

<template>
  <!-- 如果是认证页面，直接显示路由组件，否则显示基础布局 -->
  <router-view v-if="isAuthPage" />
  <BasicLayout v-else />
</template>

<style></style>
